<?php
App::uses('AttachmentBehavior', 'Uploader.Model/Behavior');

class Photo extends AppModel {
	public $actsAs = array(
			'Uploader.Attachment' => array(
					'path' => array(
							'nameCallback' => 'rename'
							)
					)
			);
	
	public $primaryKey = '_id';
	var $mongoSchema = array(
			'post_id' => array('type' => 'string'),
			'caption' => array('type' => 'string'),
			'path' => array('type' => 'string')
			);
	
	public function rename($name, $file) {
		return md5(time());
	}
}
?>